Returns the value of a property from a JSONObject or a default value if the property name is not found.
Syntax
JSONObjectGetValue("JSON", "PropertyName", DefaultReturnValue)
Arguments
| Argument | Description |
|---|---|
| JSON | JSONObject. |
| PropertyName | Property in the JSONObject. |
| DefaultReturnValue | Value to return if the property name is not found. If not specified, the default value is null. |
Return value
| Value | Description |
|---|---|
| Value | Property value from the JSONObject. |
| Null | Property name was not found. |
Example
strVal = JSONObjectGetValue("{\"propName\":\"propValue\"}", "propName")
PrintLn("Should be \"propValue\": " & strVal)